class Dizhen::GroupsController < Dizhen::BaseController
  before_filter :unread_messages_amount
  
  def index
    @topics = Topic.paginate(:page => params[:page] || 1, :conditions => "topics.group_id in (3,4,5,6)", :include => :group, :order => "topics.updated_at desc")
  end
  
  def show
    @group = Group.find(params[:id])
    @topics = @group.topics.paginate(:all, :include => :user, :page => params[:page] || 1, :order => "topics.updated_at desc")
    
    @moderators = @group.moderators
    @members    = @group.members - @moderators
  end
  
  private

end